home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-20
/
audioana.zip
/
READ.ME
< prev
Wrap
Text File
|
1991-10-18
|
14KB
|
219 lines
AUDIO SPECTRUM ANALYZER SYSTEM - - - VE2IQ.
------------------------------------------
(Special preview at Cote St-Luc fleamarket, Oct. 19th, 1991. Watch for the
complete technical article to appear in upcoming issue of QST (Jan '92)).
The board you have purchased (or constructed) goes between your rig's
audio output jack and your computer. You must supply the connecting cables.
Audio input should nominally be 400 millivolts RMS. The circuit will
overload and clip if you put in more than 600 millivolts (1.2 volts
peak-to-peak). The input impedance is 20 K ohms resistive, so it will not
load down your rig's audio output driver. Normally the audio is AC-coupled,
and referenced to halfway between the 6-volt regulated supply and ground. If
you overdrive the interface and clipping does occur, you will notice a strong
DC component appearing in the spectrum. (Clipping causes the ADC to return
constant numbers at plus or minus limit value, and the FFT program interprets
these constant values as a DC component). If you cannot obtain audio at a con-
stant level, then start at a low level, viewing the spectrum on the screen
with the Automatic Software AGC disabled (see below). While listening to a
normal off-the-air signal, crank up the audio level until the display fills
approximately two-thirds of the vertical scale, or until signs of clipping are
noticed.
Electrical connections... The interface board requires at least 9
volts DC to operate, and draws approximately 15 milliamps. It is convenient
to use a standard 9-volt Alkaline battery to power the unit, but you may also
draw the power from any other D.C. source around the shack, e.g. the 13.6 volt
rig supply, or a 12-volt gel-cell, etc. etc. The D.C. supply is regulated
down to +6 volts on the board. The board contains a charge-pump to generate
the negative voltage required to power the RS232 signal going to your comput-
er's COM1 serial port. The RS232 output from the interface board goes via a
twisted pair (not necessarily shielded) cable to the computer's COM1 port.
Only two wires are used: signal and ground. If your computer uses a 25-pin
RS232 connector, then wire the RS232 output from the ASA interface to pin 3,
"Received Data", and use pin 7 as the signal ground. (If your computer uses a
9-pin connector, then "Received Data" will be on pin 2, signal gnd on pin 5.)
The interface board must be connected to your computer's COM1 serial
port and running (powered up) - before you start the FFT program, otherwise
you will get an error message saying there is no response from serial port.
Software...
There are several versions of the Audio Spectrum Analyzer program on
this disk. The most basic version is called FFT.COM. Use it if you have an
EGA/VGA display. If you have a Hercules Graphics monochrome display, use the
program called FFTH.COM. These programs are identical otherwise, it's just
that one works with EGA/VGA, the other has a driver for Hercules mono graphics
card. These programs should work with just about any IBM PC compatible compu-
ter. You don't need a lot of memory, and the computer doesn't have to be very
fast, and you don't need a math co-processor. All you need is DOS 3.0 or
higher, a graphics adaptor, and a COM1 serial port. It is suggested not to
run other "terminate and stay resident" software concurrently with the Audio
Spectrum Analyzer, because the Fast Fourier Transform is compute intensive -
it will keep your computer real busy! If other programs are stealing cycles,
your computer may not be fast enough to keep up. If you get an error message
that says there is an overrun on the serial port, it indicates that for one
reason or another, your computer cannot keep up with the high speed flow of
digitized data from the ASA interface card. I have verified that everything
works fine on an XT clone running at 4.77 Mhz (with the Turbo mode disabled),
and that is about as slow as they get, so it should run ok on your machine.
It is important to make sure there are no other "hidden" programs running
which you may have forgotten about. For example, do not invoke the DOS print
spooler, and if it has been invoked, then you may have to re-boot to get rid
of it - this utility hangs around in memory and steals cycles from whatever
other programs happen to be running, thus slowing them down. It is easy to
overlook the fact that PRINT was invoked earlier and is still resident.
If you have a very fast computer, chances are it will easily be able
to handle the calculations required without any overrun. If this is the case,
you may wish to use the "X" versions of the above programs, FFTX and FFTXH
respectively. These expanded versions may not run on some slower computers,
though. If you are not sure if your computer is fast enough to run the "X"
versions, it can't hurt to try them anyway. You will get "overrun" messages
if the machine can't keep up. FFTX allows you to capture data to a diskfile
for later, detailed analysis. Up to one minute of coherently sampled data
may be captured in real-time and saved to a diskfile. A hard disk is recom-
mended for this. Remember that in single precision mode (one byte per digital
sample), it still needs 7200 bytes of disk space for EACH SECOND of audio!
You can use up a lot of disk space in a short time this way, hi! The format
of the recorded images on disk is straight binary. You may play back pre-
recorded sessions into FFTX at any time. FFTX also supports another format,
where 16-bit words are used instead of bytes (Double precision storage mode).
There is no reason to use it with the ASA interface board, because the little
board only digitizes the audio to 8-bit resolution anyway. The double precis-
ion mode is available in the software to accommodate possible future
versions of the interface that may sample more often and digitize the samples
to more than 8 bits. To use the capture to disk feature, invoke the FFTX pro-
gram with "FFTX CAPTURE" - and answer the resulting questions.
There is a program called LOOKSEE.COM which may be on your diskette.
This is not really part of the audio spectrum analyzer system, but is compat-
ible with the stored data format (either single or double precision) produced
by the FFTX program. LOOKSEE allows you to examine the data in the "TIME
DOMAIN" - it emulates an analog storage scope on the EGA/VGA screen. At this
time (October '91), there is only one version of LOOKSEE available. It needs
EGA/VGA graphics, and a very fast computer. A math co-processor is also
required, and still the response can be pretty slow sometimes! LOOKSEE allows
you to move a window through the data samples stored on disk and to view the
resulting waveform just like on an oscilloscope. You would see exactly the
same image if you were viewing the audio from your radio on a conventional
scope when it was recorded by FFTX. The only difference is that the signal
is frozen in time, you can look at a given "screenful" for as long as you
like, then move on to the next sequential part of the waveform, etc. The
idea is similar to "freeze frame" in a VCR. The numbers at bottom of the
screen show the range of sample numbers which are currently being displayed.
Only five keys are active: <CR> terminates and gets you back to DOS. The four
arrow keys are also active. Right arrow goes to next later part of the wave-
form, left arrow takes you earlier in time. Down arrow "Zooms in", Up arrow
"Zooms out". Down/Up arrows are equivalent to changing the time base sweep
rate on a conventional oscilloscope. The program is noticeably slow to do
this "zoom" calculation unless you have a very fast computer, because it has
to generate intermediate sample values (interpolation), in accordance with
the Sampling theorem, using Whittaker's cardinal function. When we sample
at 7200 samples per second, as long as the audio input contains no frequency
components at or above 3.6 Khz, there is no loss of information. The comput-
er is able to "reconstruct" what the waveform actually must have looked like,
no matter how far you care to "zoom" in. This "reconstruction" in software is
what takes the time.
How to run FFT.COM...
As mentioned above, do not invoke FFT unless you have the ASA interface board
connected to the COM1 serial port and powered up, or else you will get an
error message saying the serial data stream has dropped out, and this will
abort the FFT program. There are two ways to start FFT: you can just type
FFT (and then when the program is loaded, it will ask you to answer a bunch
of questions) - or you can type FFT GO, which will tell the program to use all
the default answers and get a picture on the screen right away. The first
time you try it, use the FFT GO command, just to make sure everything is
hooked up and working OK.
If you want to vary some of the variables, you can invoke the program without
the "GO" command line parameter. In this case the program will ask you to
make some choices:
SAMPLES PER SECOND [7200]: (FFTX only)
This program can handle data that was sampled at any rate, but the ASA inter-
face only samples at 7200 samples per second, so that is the default value.
If you have a diskfile of data that was generated with some other high speed
ADC board, and you know the sample rate, you can use FFTX to analyze it.
FFTLENGTH [512]:
The FFT length determines how many samples the program takes in before it does
the FFT (Fast Fourier Transform) calculation. In order to get a lot of freq-
uency resolution (i.e. to distinguish between two frequency components which
are close together) - the program needs more samples. The trade-off is that
it takes longer to acquire those samples (at the constant rate of 7200 samples
per second), and the computation also slows down noticeably for long FFT's.
Keep in mind that the horizontal resolution of an EGA/VGA display is only 640
pixels, and we use a few of those at the left of the screen for the vertical
axis labelling, so only about 600 individual spectral lines can be shown, then
we run out of pixels anyway. The number of spectral lines available will be
one half the FFT length. This program (FFT or FFTX) can handle FFT's up to
4096 points, or with a fine frequency resolution of 2048 lines, these lines
spaced 1.75 Hz apart. Obviously we cannot display 2048 spectral lines on a
640-pixel horizontal resolution display, so something has to give. What hap-
pens is that you may also choose a limited range of frequencies to view, in-
stead of looking at the whole spectrum from DC to 3.6 Khz. For example, if
you are only interested in signals around 800 Hz, you might ask to view the
spectrum between 750 Hz and 850 Hz, in which all the available spectral lines
could be displayed. If you still ask for more lines than can be physically
shown on the display, the program will throw out some spectral lines in order
to fit the resulting display on the screen. The default FFT length of 512
points has been found to be a good all-around compromise. It makes a nice
display and fits the whole spectrum on the screen at once.
NAME OF .AUD FILE:
If you get this far and you still want to look at REAL-TIME data coming in via
the COM1 serial port, you can answer this with "SERIAL". Otherwise, give the
name of a diskfile containing previously-recorded data. The default suffix
for files of this type is .AUD.
LOWEST, HIGHEST FREQUENCIES OF INTEREST: [0..3600]:
If you just enter a <CR> here, the default range (DC through 3.6Khz) will be
used. If you want to enter a more restrictive range of frequencies, you may
enter two (2) numbers, separated by a single space and followed by <CR>. The
first number is the lower frequency limit in Hertz, the second number is the
upper frequency limit. The resulting display may not be scaled exactly the
way you asked for it, but it should at least include the spectral lines within
your requested limits.
SPOT, INTEGRATE, CONTINUOUS[C]:
SPOT - this does one FFT, then pauses for user acknowledgment. Enter <CR> to
go on and do another FFT. Enter Q <CR> to Quit.
INTEGRATE - this mode sums up a whole bunch of consecutive FFT's and shows
the resulting averaged spectrum on the screen. It is useful for looking at
passband response of IF filters, etc, using only noise (presumed flat) as the
signal input. Kill the mode with a <CR>.
CONTINUOUS - This is a real-time display of the spectrum as it is happening.
As the audio signal source changes, the spectral display will change. Use
<CR> to quit the program.
SOFTWARE AGC [Y]:
Software AGC attempts to fill the screen vertically even though there may be
very little signal energy available. It is like AGC action in your radio.
When the station you are watching goes QRT, the "grass" at the bottom of the
screen will grow, and you may start to see components in there that are picked
up from the computer, the wires around the shack, etc. The actual amplitudes
of such weak signals in the shack may be miniscule, but the software AGC will
blow everything up to fill the screen, and this could give misleading results.
The default choice (AGC enabled) - is good for just tuning around looking at
stuff you get off the air. Any strong signal will cause the AGC action to
suppress the grass (noise) at bottom on the screen. Turn off the Software AGC
if you want to make calibrated comparisons, e.g. to compare the amplitude of
two signals on an absolute scale.
73 & Good viewing de VE2IQ.
Watch for upcoming article in QST (January or February issue, I hope) -talk-
ing about this system in more detail. The article should explain pretty well
how the FFT algorithm works, for those who are interested in such things.
Circuit boards will be available to QST readers for $24 US, and the software
will also be available from Compuserve and possibly other bulletin boards.
The program source code will be available to readers of QST for a nominal
fee.